Fractal Block World

Console Commands


This documentation was created for the following version of the program: 1.01.29
One can toggle the console (while in game) by pressing the '~' key.

Commands can be entered while in the console. For example, entering the command "exit" will exit the program.

All commands return a value. One can input complex commands using S-expressions. For example, "echo (vec 1.0 2.0 3.0)" will print "1 2 3" to the console. The outermost S-expression should not have parentheses around it. For another example, "echo (if (== (+ 2 3) 5) 1 0)" will print "1" to the console.

The dollar sign '$' followed by a string literal is syntactic sugar for the "get" command.

One can list all the commands from the console using the help command. This can also be used to print information about individual commands. All that help information is included in this html document. In fact, this document was generated using the "gendoc" command.

Console commands are built into the program. However aliases can be created in user defined scripts. Therefore, in a different configuration of the program, you may not see the same aliases as are listed here.



bind
Usage: bind
bind dump_inputs
bind dump_actions
bind INPUT_EVENT get
bind INPUT_EVENT unbind
bind INPUT_EVENT toaction ACTION
bind INPUT_EVENT tocommand CMD
bind INPUT_EVENT tocommands CMD1 CMD2
bind get_inputs ACTION

Binds an action or command (or commands) to an
input action. The get_inputs version gets a
string showing all input events bound to the
given action.


dumplua
Usage: dumplua

Outputs to Output/lua_env_dump.txtall the global
variables in the game Lua state.


q2md2
Usage: q2md2 cmd

cmd can be one of the following: stand, run,
attack, pain, jump_up, jump_down, flip, salute,
taunt, wave, point, crstand, crwalk, crattack,
crattack, crpain, crdeath1, death1, death2,
death3


teleport
Usage: teleport

This is not intended for use until 1.01.29.


game_input
Usage: game_input str

Gives a string to the (package) game code.


use
Usage: use
use2

The command "use" "Uses" the basic entity (or
block or moving entity) that the player is
looking at (the use object). That is, a Lua
function called __use is called. The command
"use 2" uses the secondary use function of the
use object. That is, a Lua function called
__use2 is called.


respawn
Usage: respawn (passive | force) str_param

Respawns the player. The argument str_param can
be omitted. The passive version only respawns
the player if he is dead. The forceful version
respawns the player no matter what. The
package's top.__respawn_player function will be
passed str_param.


gendoc
Usage: gendoc

Generates an html file with documentation about
all commands.


grow
Usage: grow

Grows player to the level that is one coarser.


shrink
Usage: shrink

Shrinks player to the level that is one finer.


debug_levs_dump
Usage: debug_levs_dump

Outputs how many chunks are on each level.


debug_chunk_dump
Usage: debug_chunk_dump

Dumps information about the chunk that contains
the player. The commands "path" and "script"
also dump useful information about that chunk.


debug_mom_dump
Usage: debug_mom_dump
Prints the number of objects of various types, tracked by a "singleton" class. This can be used to find leaks.


script
Usage: script

Displays the Lua script for the chunk that
contains the viewer.


tostring
Usage: tostring EXP

Returns the expression EXP converted to a string.


mutate
This is an alias for the command
"toggle game.globals.worldgen.state.one_way".


..
Usage: .. STR1 STR2 ... STRN

Returns the strings concatenated together.


+
Usage: + X Y

Returns X plus by Y. If X and Y are both ints,
then an int will be returned. If one of X or Y
is a float, then a float will be returned.


seq
Usage: seq EXP_1 EXP_2 ... EXP_N

Evaluates the expressions EXP_1 through EXP_N
from left to right, returning the value that
EXP_N evaluates to. That is, this command can be
used to execute a sequence of commands. For
example, "seq (echo hello) (echo there)" will
print "hello" and then "there" to the console,
and void will be returned (because "(echo there)"
evaluates to void).


execf
Usage: execf FILENAME

Executes all the commands in the file FILENAME.
Every line of the file should be either a valid
S-expression or a comment line (all whitespace or
starting with the character '#'). FILENAME
should be a path relative to the directory
Input/Scripts/.


god
Usage: god
god on
god off

Toggles godmode (invulnerability).


*
Usage: * X Y

Returns X multiplied by Y. If X and Y are both
ints, then an int will be returned. If one of X
or Y is a float, then a float will be returned.


toggle
Usage: toggle VAR_NAME

Equivalent to "set VAR_NAME (not (get
VAR_NAME))".


==
Usage: == EXP1 EXP2

Returns true if the expressions EXP1 and EXP2 are
equal, otherwise returns false.


unalias
Usage: unalias name ALIAS_NAME
unalias all

The command "unalias name ALIAS_NAME" removes the
alias ALIAS_NAME The command "unalias all"
removes all aliases.


get
Usage: get VAR

Returns the value stored by the environment
variable VAR. Note that the dollar sign followed
by a string literal is syntactic sugar for the
get command. That is, "$VAR" is equivalent to
"(get VAR)".


vec
Usage: vec X Y Z

Returns the vector whose components are the
floats X,Y,Z.


delete
Usage: delete VAR_NAME

Deletes the environment variable. Note: VAR_NAME
must start with "home.".


set
Usage: set VAR_NAME VALUE

Sets the environment variable VAR_NAME to VALUE.


exit
Usage: exit
Usage: exit unsafe

Exits the program. The command "exit unsafe"
will exit the program but no perform the usual
cleanup.


echo
Usage: echo STRING

Prints the string STRING to the console.


type
Usage: type EXP

Returns the type of the expression EXP. For
example, "echo (type (vec 1.0 2.0 3.0))" will
print "vector" to the console.


noclip
Usage: noclip
noclip on
noclip off

Toggles noclip mode (moving through walls).


+=
Usage: += VAR X

Multiplies the environment variable VAR by X.
Note: The types of $VAR and X must agree.


save
Usage: save
save nosound

save passive The commands "save" and "save
nosound" will save the game. The command "save
passive" will only save the game if at least one
of the two conditions are met: 1) 5 minutes have
passed since the last save or 2) there are at
least 10 thousand chunk that need to be saved.


ls
Usage: ls
ls PATH
ls PATH v

The command "ls" lists all variables in the
"current working directory" (See also: cd, pwd).
The command "ls PATH" lists all variables in the
name directory PATH. The command "ls PATH v"
lists the name and values of all variables in the
name directory PATH.


print
Usage: print STR

Prints the string STR to standard output.


shrinkany
Usage: shrinkany
shrinkany on
shrinkany off

The command "shrinkany" toggles the ability to
shrink/enlarge at any time.


let
Usage: let VAR_NAME VALUE
let VAR_NAME VALUE newonly

Creates/sets the environment variable VAR_NAME to
VALUE. Note: VAR_NAME must start with "home.".If
the "newonly" option is used, it will only set
the var if it DOES NOT already exist.


debug_tex_dump
Usage: debug_tex_dump
The command "debug tex_dump" prints:

1) the total memory usage for all loaded
textures, 2) how many seconds it has been since
each texture was used, and 3) the size of each
texture.


telehome
Usage: telehome

Teleports you back to your EMERGENCY waypoint.


alias
Usage: alias ALIAS_NAME CMD_STRING

Adds a new alias called ALIAS_NAME which
evaluates to the command CMD_STRING. Although an
existing alias can be replaced by a new alias, a
command cannot be replaced. Arguments can be
given using @1 through @9. For example, alias
"foo" "echo HELLO" makes it so when you enter the
command "foo", then HELLO is printed. On the
other hand the command alias "foo" "echo @1"
makes it so when you enter the command "foo bar",
then "bar" will be printed. For another example,
after running command alias "foo" "+ @1 @2" and
then the command "echo (foo 5 7)", then 12 is
printed.


exec
Usage: exec COMMAND_STR

Executes the command stored by COMMAND_STR. For
example, "exec $foo" will execute the command
string stored in the environment variable foo.


dumpenv
Usage dumpenv

Prints all of the environment variables to
standard output.


not
Usage: not BOOL

Returns the negation of the bool BOOL.


man
Usage: man ENV_VAR

Displays the documentation for the given
environment variable.


cheat
Usage: cheat PASSWORD
cheat PASSWORD nosound
cheat off
cheat chpasswd newpassword

Enables cheat codes if password is correct. Or
disables cheat codes if "cheat off" is used. Can
change the password using "cheat chpasswd".


execl
Usage: execl mod.func str_arg

This calls the Lua function named "func" in the
Lua file "mod.lua". The string str_arg is
optional (but if it exists it will be passed to
the mod.func function. Note that in mod.lua, the
function func should be delcared as function
p.func(str) ... end The command execl will look
for scripts in the Game/ folder of the current
package and the Input/Scripts directory. This
way the user can use their own Lua scripts for
keybindings.


screenshot
Usage: screenshot
Usage: screenshot no_hud

Takes a screenshot and saves to
"Output/Screenshots/" folder.


gen
This is an alias for the command
"toggle game.globals.worldgen.state.genesis".


debug_wc_dump
Usage: debug_wc_dump
Prints information about the "chunk changes" objects (wc stands for "world changes").

A chunk changes object stores all changes that
have been made to a chunk since the begining of
the player's game (game time zero). When a
player saves the game, these objects are written
to "chunk files" on the hard drive and the chunk
changes objects are destoyed.


debug_cf_dump
Usage: debug_cf_dump
debug_cf_dump db2_to_db1

Outputs the number of chunk files, and their
revert times.


help
Usage: help
help NAME

The command "help" lists all commands in white
and aliases in pink. The command "help NAME"
prints help information about the command or
alias NAME.


close
Usage: close

Closes the game, but does not exit the program.


saveclose
Usage: saveclose

Saves the game and then close the game (but not
exit the program).


clear
Usage: clear

Clears the console screen.


saveexit
Usage: saveexit

Saves the game and then immediately exists the
program.


saveload
Usage: saveload
saveload hard
saveload soft

Saves the game and then immediately loads the
game. See the "load" command for what the
options "hard" and "sort" do.


*=
Usage: *= VAR F

Multiplies the environment variable VAR by the
float F.


load
Usage: load
load hard
load soft

Loads the last saved game. The command "load
hard" will reload the package, whereas "load
soft" will reuase package data resulting in a
faster load time. The command "load" will use
the value of engine.soft_loading to determine if
it will be a hard or a soft load.


path
Usage: path
path last
path pos
path dump
path hex

The command "path last" prints the name of the
Lua script for the chunk containing the viewer.
The command "path" prints the names of the
scripts for all chunks in the path from the root
of the chunk tree to the viewer. The command
"path listpos" does with list does but also
prints the chunk path from the root. The command
"path dump" prints the chunk path to the file
Output/path.txt". The command "path hex" prints
the path from the root of the chunk tree.